Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable opentelemetry installation for unit tests #4871

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

felixfontein
Copy link
Collaborator

SUMMARY

Regularly CI (unit tests) is breaking because Protobuf for Python that's required by opentelemetry:

01:16 ______ ERROR collecting tests/unit/plugins/callback/test_opentelemetry.py ______
01:16 tests/unit/plugins/callback/test_opentelemetry.py:12: in <module>
01:16     from ansible_collections.community.general.plugins.callback.opentelemetry import OpenTelemetrySource, TaskData, CallbackModule
01:16 <frozen importlib._bootstrap>:991: in _find_and_load
01:16     ???
01:16 <frozen importlib._bootstrap>:975: in _find_and_load_unlocked
01:16     ???
01:16 <frozen importlib._bootstrap>:671: in _load_unlocked
01:16     ???
01:16 /root/ansible/lib/ansible/utils/collection_loader/_collection_finder.py:434: in exec_module
01:16     exec(code_obj, module.__dict__)
01:16 plugins/callback/opentelemetry.py:89: in <module>
01:16 E    1. Downgrade the protobuf package to 3.20.x or lower.
01:16 E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
01:16 E   
01:16 E   More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

(Python 3.8 and 3.9)

See for example https://dev.azure.com/ansible/community.general/_build/results?buildId=45905&view=results

This is usually fixed after a couple of days, but this is really annoying me, so I'm going to disable these tests by removing the dependencies from tests/unit/requirements.txt.

ISSUE TYPE
  • Test Pull Request
COMPONENT NAME

unit tests

@felixfontein
Copy link
Collaborator Author

CC @v1v

@felixfontein felixfontein merged commit 1eee35d into ansible-collections:main Jun 21, 2022
@felixfontein felixfontein deleted the ci branch June 21, 2022 19:39
@patchback
Copy link

patchback bot commented Jun 21, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/1eee35dffbaf5952e4a24da750c008092dfc8ba3/pr-4871

Backported as #4872

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback
Copy link

patchback bot commented Jun 21, 2022

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/1eee35dffbaf5952e4a24da750c008092dfc8ba3/pr-4871

Backported as #4873

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jun 21, 2022
felixfontein added a commit that referenced this pull request Jun 21, 2022
(cherry picked from commit 1eee35d)

Co-authored-by: Felix Fontein <felix@fontein.de>
felixfontein added a commit that referenced this pull request Jun 21, 2022
(cherry picked from commit 1eee35d)

Co-authored-by: Felix Fontein <felix@fontein.de>
@v1v
Copy link
Contributor

v1v commented Jun 22, 2022

Thanks @felixfontein I wonder if pin the transitive dependency could help in this particular case.

Likely related to protocolbuffers/protobuf#10051 and open-telemetry/opentelemetry-python#2717

@felixfontein
Copy link
Collaborator Author

@v1v that could work. It might be a bit tricky though since the pin is probably dependent on the Python version as well. On the other hand, just not installing it for older Python version is still better than not installing it at all.

@kushan-gunasekera
Copy link

For anyone who is looking for a proper solution,

answer:- https://stackoverflow.com/a/72493690/6194097

@felixfontein
Copy link
Collaborator Author

I think export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python would be the best solution, as protobuf==3.20.* sounds a bit like a timebomb waiting to explode :) Unfortunately we don't have that much control over the requirement install process for the unit tests (it's all done by ansible-test automatically).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants